import selfAxios from '@/utils/selfAxios';

export default {
    // 获取员工数据列表和查询员工信息

    getList(page, size, searchMap) {
        return selfAxios({
            url: `/staff/list/${page}/${size}`,
            method: 'post',
            data: searchMap
        });
    },
    //增加员工信息
    add(staffData) {
        return selfAxios({
            url: '/staff',
            method: 'post',
            data: staffData
        });
    },
    //通过id获取员工信息
    getStaffMsg(id) {
        return selfAxios({
            url: `/staff/${id}`,
            method: 'get',

        });
    },
    //通过ID更新员工信息
    update(id, updatedData) {
        return selfAxios({
            url: `/staff/${id}`,
            method: 'put',
            data: updatedData
        });
    },
    delete(id) {
        return selfAxios({
            url: `/staff/${id}`,
            method: 'delete'
        })
    }
}